package com.itheima.zxy;

import javax.swing.*;

public class demo04 {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setSize(660, 500);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setLocationRelativeTo(null);
        jf.setLayout(null);

        JButton btn1 = new JButton("btn1");
        btn1.setSize(70, 30);
        btn1.setLocation(10, 10);
        JButton btn2 = new JButton("btn2");
        btn2.setSize(80, 40);
        btn2.setLocation(100, 10);
        JButton btn3 = new JButton("btn3");
        btn3.setSize(40, 30);
        btn3.setLocation(10, 100);
        JButton btn4 = new JButton("btn4");
        btn4.setSize(70, 60);
        btn4.setLocation(100, 100);

        jf.add(btn1);
        jf.add(btn2);
        jf.add(btn3);
        jf.add(btn4);

        jf.setVisible(true);
    }
}
